//
//  FLLFifthSectionHeaderView.m
//  FLLGodOfCookery
//
//  Created by LL.F on 16/9/1.
//  Copyright © 2016年 LL.F. All rights reserved.
//

#import "FLLFifthSectionHeaderView.h"
#import "Masonry.h"

@implementation FLLFifthSectionHeaderView
- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if ( self) {
        [self createSubViews];
        
    }
    return self;
}
- (void)createSubViews
{
    
    self.grayLabel = [[UILabel alloc] init];
    _grayLabel.backgroundColor = [UIColor colorWithRed:0.93 green:0.93 blue:0.93 alpha:1.00];
    [self addSubview:_grayLabel];
    
    self.titleLabel = [[UILabel alloc] init];
//    _titleLabel.backgroundColor = [UIColor redColor];
    _titleLabel.text = @"区头";
    [self addSubview:_titleLabel];
    
    self.moreButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [_moreButton setImage:[[UIImage imageNamed:@"more_icon"] imageWithRenderingMode:1 ]forState:UIControlStateNormal];
    [self addSubview:_moreButton];
    
    self.grayLine = [[UILabel alloc] init];
    _grayLine.backgroundColor = [UIColor colorWithRed:0.78 green:0.78 blue:0.80 alpha:1.00];
    [self addSubview:_grayLine];

    
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    [_grayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.mas_equalTo(0);
        make.height.mas_equalTo(10);
    }];

    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(5);
        make.bottom.mas_equalTo(0);
        make.centerX.mas_equalTo(0);
    }];
    
    
    [_moreButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.mas_equalTo(20);
        make.left.mas_equalTo(_titleLabel.mas_right).mas_offset(20);
        make.top.mas_equalTo(0).mas_equalTo(20);
    }];
    
    [_grayLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.mas_equalTo(0);
        make.height.mas_equalTo(1);
    }];

}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
